using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Lesson4Test
{
    public Lesson4Test()
    {
        //开启协程
        MonoMgr.GetInstance().StartCoroutine(Test123());
    }

    //帧更新事件
    public void Update()
    {
        Debug.LogFormat("[Lesson4Test][Update]");
    }

    IEnumerator Test123()
    {
        yield return new WaitForSeconds(1f);
        Debug.LogFormat("[Lesson4Test][Test123]...");
    }
}

public class Lesson4 : MonoBehaviour
{
    Lesson4Test test;
    // Start is called before the first frame update
    void Start()
    {
        test = new Lesson4Test();
        //添加帧更新方法
        MonoMgr.GetInstance().AddUpdateListener(test.Update);
    }
}